# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=aspell-ru
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
_pkgver=0.99f7-1
pkgver=${_pkgver//-/.}
pkgrel=1
pkgdesc="Russian dictionary for aspell (mingw-w64)"
arch=('any')
url="http://aspell.net/"
license=('custom')
depends=("${MINGW_PACKAGE_PREFIX}-aspell")
source=(https://ftp.gnu.org/gnu/aspell/dict/ru/aspell6-ru-${_pkgver}.tar.bz2
        001-unixy-dirs.patch)
sha256sums=('5c29b6ccce57bc3f7c4fb0510d330446b9c769e59c92bdfede27333808b6e646'
            '1e2680a4e6498e1a2eb4e0e1f52eac3c8b2d76627ab8df7bb36bdc686d814ad3')

prepare() {
  cd "${srcdir}/aspell6-ru-${_pkgver}"
  patch -p1 -i ${srcdir}/001-unixy-dirs.patch
}

build() {
  cd "${srcdir}/aspell6-ru-${_pkgver}"
  ./configure
  sed -i 's/C\:\\msys64\\/\//' Makefile
  make
}

package() {
  cd "${srcdir}/aspell6-ru-${_pkgver}"
  make DESTDIR="${pkgdir}" install

  install -D -m644 Copyright "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE"
}
